﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace LeafTransmission.Entity
{
    /// <summary>
    /// 网卡实体类
    /// </summary>
    internal class NICEntity
    {
        private string _physicalAddress = "";

        public string? Id { get; set; }
        public string? Name { get; set; }
        public string? NetworkInterfaceType { get; set; }
        public string Description { get; set; }
        /*public string PhysicalAddress
        {
            get { return _physicalAddress; }
            set
            {
                string result = "";
                string temp = value;
                for (int i = 0; i < temp.Length; i += 2)
                {
                    result += temp.Substring(i, 2) + "-";
                }
                result = result.Remove(result.Length - 1, 1);
                _physicalAddress = result;
            }
        }*/
        public string PhysicalAddress { get; set; }
        
        public string? Speed { get; set; }
        // 操纵状态 Up / Down
        public string? OperationalStatus { get; set; }
        /*
         * 获取此网络接口的最大传输单位 (MTU)。
         * 网络接口的 MTU 是可以传输的最大数据包。 它以八进制数(8 位字节) 度量。
         */
        public int? IPv4Mtu { get; set; }
        public string IPv4Address { get; set; }
        public string IPv4Mask { get; set; }
        public bool Selected { get; set; }

        public NICEntity() { }

        public NICEntity(string id, string name, string networkInterfaceType, string description, string physicalAddress, string speed, string operationalStatus, int iPv4Mtu, string iPv4Address, string iPv4Mask, bool selected)
        {
            Id = id;
            Name = name;
            NetworkInterfaceType = networkInterfaceType;
            Description = description;
            PhysicalAddress = physicalAddress;
            Speed = speed;
            OperationalStatus = operationalStatus;
            IPv4Mtu = iPv4Mtu;
            IPv4Address = iPv4Address;
            IPv4Mask = iPv4Mask;
            Selected = selected;
        }

        
    }
}
